home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------
- -- Created By: <your_name>
- -- Description: <short_description>
- --------------------------
- --
-
- AIBehaviour.MutantCoverAttack = {
- Name = "MutantCoverAttack",
-
- counter = 0,
-
- -- SYSTEM EVENTS -----
- ---------------------------------------------
- OnNoTarget = function( self, entity )
- -- called when the enemy stops having an attention target
- AI:Signal(SIGNALID_READIBILITY, 1, "STAY_ALERT",entity.id);
-
-
- end,
-
- ---------------------------------------------
- OnCloseContact = function ( self, entity, sender)
- local rnd=random(1,5);
- --System:LogToConsole("\001 CLOSE CONTACT");
- entity:InsertMeleePipe("attack_melee"..rnd);
- --entity:InsertSubpipe(0,"m_c_melee_attack");
- end,
-
- ---------------------------------------------
- OnPlayerSeen = function( self, entity, fDistance )
-
- entity:SelectPipe(0,"m_c_rush_target");
-
- if (fDistance>10) then
- entity:SelectPipe(0,"m_c_shoot");
- end
-
- AI:Signal(SIGNALID_READIBILITY, 1, "THREATEN",entity.id);
-
- entity:InsertSubpipe(0,"DropBeaconAt");
-
- end,
- ---------------------------------------------
- OnEnemyMemory = function( self, entity )
- -- rush to the player position
- if (entity.AI_RocketDanger) then
- entity:StartAnimation(0,"NULL",4);
- entity:SelectPipe(0,"DropBeaconAt");
- entity:SelectPipe(0,"m_c_rush_target");
- end
- AI:Signal(SIGNALID_READIBILITY, 1, "ENEMY_TARGET_LOST",entity.id);
- end,
-
- ---------------------------------------------
- OnGrenadeSeen = function( self, entity, fDistance )
- -- called when the enemy hears a scary sound
- entity:InsertSubpipe("devalue_target");
- end,
-
-
- ---------------------------------------------
- OnInterestingSoundHeard = function( self, entity )
- -- called when the enemy hears an interesting sound
- end,
- ---------------------------------------------
- OnThreateningSoundHeard = function( self, entity )
- -- called when the enemy hears a scary sound
- end,
- ---------------------------------------------
- OnReload = function( self, entity )
- -- called when the enemy goes into automatic reload after its clip is empty
- end,
- ---------------------------------------------
- OnGroupMemberDied = function( self, entity )
- -- called when a member of the group dies
- AI:Signal(SIGNALID_READIBILITY, 2, "RESPOND_DOWN",entity.id);
-
- end,
- ---------------------------------------------
- OnNoHidingPlace = function( self, entity, sender )
- -- called when no hiding place can be found with the specified parameters
- entity:SelectPipe(0,"mutant_cover_cover");
- end,
- --------------------------------------------------
- OnNoFormationPoint = function ( self, entity, sender)
- -- called when the enemy found no formation point
- end,
- ---------------------------------------------
- OnReceivingDamage = function ( self, entity, sender)
- -- called when the enemy is damaged
- -- if (entity.AI_RocketDanger==nil) then
- entity:StartAnimation(0,"NULL",4);
- entity:InsertSubpipe(0,"m_c_quickhide");
- -- end
-
- end,
- ---------------------------------------------
- OnCoverRequested = function ( self, entity, sender)
- -- called when the enemy is damaged
- end,
-
- --------------------------------------------------
- OnBulletRain = function ( self, entity, sender)
- -- called when the enemy detects bullet trails around him
- end,
- --------------------------------------------------
-
- RUSH_TARGET = function (self, entity, sender)
- entity:SelectPipe(0,"m_c_rush_target");
- end,
-
- -- GROUP SIGNALS
- ---------------------------------------------
- MUTANT_COVER_UP = function (self, entity, sender)
- entity.cnt.AnimationSystemEnabled = 0;
- entity.isSelfCovered = 1;
- entity:StartAnimation(0,"ballup_stay",0,0.1,1);
- end,
- ---------------------------------------------
- MUTANT_COVER_DOWN = function (self, entity, sender)
-
- if(entity.isSelfCovered == 0) then return end
- entity.cnt.AnimationSystemEnabled = 1;
- entity.isSelfCovered = 0;
- entity:StartAnimation(0,"sidle",0,0.1,1);
- end,
-
- ---------------------------------------------
- MUTANT_CLOSE_ATTACK = function (self, entity, sender)
- local rnd = random(1,25);
-
- -- entity:SelectPipe(0,"mutant_cover_close_attack");
- -- do return end
-
- if (rnd<10) then
- entity.lastMeleeAttackTime = _time + 3; -- don't do close attack in next 3 seconds
- AI:Signal(0, 1, "MUTANT_BACKOFF_ATTACK",entity.id);
- else
- entity:SelectPipe(0,"mutant_cover_close_attack");
- end
- end,
-
- ---------------------------------------------
- MUTANT_NORMAL_ATTACK = function (self, entity, sender)
-
- -- if(self.counter == 1) then
- -- self.counter = 0;
- -- entity:SelectPipe(0,"mutant_cover_close_attack");
- -- else
- -- self.counter = 1;
- -- entity:SelectPipe(0,"mutant_standard_attack");
- -- end
- --do return end;
-
- AI:Signal(0, 1, "MUTANT_COVER_DOWN",entity.id);
-
- local rnd = random(1,25);
- -- if (rnd<5 and entity.suppressedValue<entity.Properties.suppressedThrhld*.6) then
- if (rnd<7 and entity.cnt:CounterGetValue("SuppressedValue")<entity.Properties.suppressedThrhld*.6) then
-
- entity:SelectPipe(0,"mutant_cover_close_attack");
- -- elseif (rnd<10) then
- -- entity:SelectPipe(0,"mutant_standard_attack");
- elseif (rnd<15) then
- entity:SelectPipe(0,"mutant_cover_attack");
- else
- entity:SelectPipe(0,"mutant_cover_strafe");
- end
- end,
-
- ---------------------------------------------
- MUTANT_BACKOFF_ATTACK = function (self, entity, sender)
-
- AI:Signal(0, 1, "MUTANT_COVER_DOWN",entity.id);
-
- local rnd = random(1,20);
- if (rnd<5) then
- entity:SelectPipe(0,"mutant_cover_backoffattack");
- elseif (rnd<10) then
- entity:SelectPipe(0,"mutant_standard_attack");
- else
- entity:SelectPipe(0,"mutant_cover_strafe");
- end
- end,
-
-
- ---------------------------------------------
- MUTANT_COVER_STRAFE = function (self, entity, sender)
- local rnd = random(1,20);
- if (rnd<10) then
- entity:InsertSubpipe(0,"mutant_cover_strafe_right");
- else
- entity:InsertSubpipe(0,"mutant_cover_strafe_left");
- end
- end,
-
- ---------------------------------------------
- MUTANT_COVER_SUPPRESSED = function( self, entity )
-
-
- -- if(entity.suppressedValue < entity.Properties.suppressedThrhld) then return end
- if(entity.cnt:CounterGetValue( "SuppressedValue" ) < entity.Properties.suppressedThrhld) then return end
-
- entity:SelectPipe(0,"mutant_cover_cover");
- entity.cnt:CounterSetValue( "SuppressedValue", entity.Properties.suppressedThrhld*.2);
- -- entity.suppressedValue = entity.Properties.suppressedThrhld*.2;
-
- end,
-
- ---------------------------------------------
- MUTANT_COVER_HUNT = function( self, entity )
- -- called when the enemy can no longer see its foe, but remembers where it saw it last
-
- --System:Log("\001 MUTANT_COVER_HUNT <<<<<<<<<<<<<");
-
- AI:Signal(0, 1, "MUTANT_COVER_DOWN",entity.id);
-
- local rnd = random(1,15);
- if (rnd<5) then
- entity:SelectPipe(0,"mutant_cover_hunt");
- elseif( rnd<10 ) then
- entity:SelectPipe(0,"mutant_cover_strafe_hunt_left");
- else
- entity:SelectPipe(0,"mutant_cover_strafe_hunt_right");
- end
-
- end,
-
- ---------------------------------------------
-
-
-
-
- }